﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace QQSDK
{
    /// <summary>
    /// 无起屏广告测试场景 - 注意如果单独使用当前场景的SDKManager要启用
    /// </summary>
    public class MainSample : MonoBehaviour
    {
        public GameObject SDKManager; //- 注意如果单独使用当前场景的SDKManager要启用

        private void Awake()
        {
            if (SDKManager != null)
            {
                GameObject obj = GameObject.Find("SDKManager");
                if (obj == null)
                {
                    SDKFunc.LogError("Main场景做主场景是 SDKManager 对象必须是开启状态！");
                }
            }

        }
        public void Start()
        {


            //System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> dt = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>();
            //System.Collections.Generic.List<string> ls = new System.Collections.Generic.List<string>();
            //ls.Add("21212");
            //dt.Add("sss",ls);
            //string sr = JsonMapper.ToJson(dt);
            //SDKFunc.Log(sr);

            //System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> ds =  JsonMapper.ToObject<System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>>(sr);
            //QQSDK.SDKManager.onIAPDataCallback += (iapdata) =>
            //{
            //    SDKFunc.Log("iaphuidao:"+ iapdata);
            //};

        }
        /// <summary>
        /// Awake is called when the script instance is being loaded.
        public void OnClickAdsSampleBtn()
        {
            SDKFunc.Log("进入广告测试场景");
            SceneManager.LoadScene("AdsSample");
        }
        public void OnClickAttributionSampleBtn()
        {
            SDKFunc.Log("进入归因场景");
            //SceneManager.LoadScene("PromotionSample");
            SceneManager.LoadScene("AttributionSample");
        }
        public void OnClickToolsSampleBtn()
        {
            SDKFunc.Log("进入工具类测试场景");
            SceneManager.LoadScene("ToolsSample");
        }
        public void onClickAnalyticsSample()
        {
            SDKFunc.Log("进入打点测试场景");
            SceneManager.LoadScene("AnalyticsSample");
        }

        public void onClickThirdSample()
        {
            SDKFunc.Log("进入第三方场景");
            SceneManager.LoadScene("ThirdSample");
        }
    }
}